/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.ta.web;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;

import com.thinkgem.jeesite.common.web.BaseController;
import com.thinkgem.jeesite.modules.sys.entity.User;
import com.thinkgem.jeesite.modules.sys.utils.UserUtils;
import com.thinkgem.jeesite.modules.ta.util.GetWebServicePathUtil;

/**
 * 处理Controller
 * 
 * @author 刘雨轩
 * @version 2017-05-26
 */
@Controller
@RequestMapping(value = "${adminPath}/ta/chuLi")
public class ChuLiController extends BaseController {

//	@Autowired
//	private StSuspendService stSuspendService;
//
//	@Autowired
//	private XtSuspendApplyService xtSuspendApplyService;

	@RequiresPermissions("ta:chuLi:view")
	@RequestMapping(value = { "list", "" })
	public String list(String ItemId, String iid, String step,
			HttpServletRequest request, RedirectAttributes redirectAttributes,
			HttpServletResponse response) {
		User user = UserUtils.getUser();
		if (user == null) {
			return "modules/sys/sysLogin";
		}
		String userId = user.getNo();
		String path = GetWebServicePathUtil.getTpPath(ItemId, iid, step,
				userId, request);
//		StSuspend stSuspend = stSuspendService.get(iid);
//		XtSuspendApply xtSuspendApply = xtSuspendApplyService.get(iid);
		String pathUrl = "redirect:" + path;
		System.out.println(path);
		/*if (stSuspend != null && stSuspend.getEndUserid() == null) {
			addMessage(redirectAttributes, "此事务挂起中不能处理！请先解挂！");
			pathUrl = "redirect:" + Global.getAdminPath()
					+ "/ta/workListForWorklistNode/?repage";
		}
		if (xtSuspendApply != null
				&& xtSuspendApply.getIsdelete() == Long.parseLong("1")) {
			addMessage(redirectAttributes, "此事务挂起审核申请中不能处理！请先取消挂起！");
			pathUrl = "redirect:" + Global.getAdminPath()
					+ "/ta/workListForWorklistNode/?repage";
		}*/
		return pathUrl;

	}

}